package com.neusoft.nepm.controller;

import java.util.List;

import com.neusoft.nepm.dto.*;
import com.neusoft.nepm.po.Supervisor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.neusoft.nepm.po.GridMember;
import com.neusoft.nepm.service.IGridMemberService;

@RestController
@RequestMapping("/gridMember")
public class GridMemberController {

	@Autowired
	private IGridMemberService gridMemberService;
	
	/************************** nepm工程 **************************/
	@RequestMapping("/listGridMemberByProvinceId")
	public List<GridMember> listGridMemberByProvinceId(@RequestBody GridMember gridMember){
		return gridMemberService.listGridMemberByProvinceId(gridMember);
	}
	
	/************************** nepm工程 **************************/
	
	/************************** nepg工程 **************************/
	@RequestMapping("/getGridMemberByCodeByPass")
	public GridMember getGridMemberByCodeByPass(@RequestBody GridMember gridMember){
		return gridMemberService.getGridMemberByCodeByPass(gridMember);
	}
	@RequestMapping("/listGridMemberPage")
	public PageResponseDto<GridMember> listGridMemberPage(@RequestBody GmpageRequestDto gmPageRequestDto){


		return gridMemberService.listGridMemberPage(gmPageRequestDto);
	}
	@RequestMapping("/addRemarksById")
	public String addRemarksById(@RequestBody GmRemarksDto gmRemarksDto){

		System.out.println(gmRemarksDto.getRemarks());
		return gridMemberService.addRemarksById(gmRemarksDto);
	}
	@GetMapping("/getById/{gmId}")
	public GridMember getGridMemberById(@PathVariable String gmId) {
		return gridMemberService.getGridMemberById(gmId);
	}
	@PostMapping("/update")
	public String updateGridMember(@RequestBody GridMember gridMember) {
		gridMemberService.updateSupervisor(gridMember);
		return "Success";
	}
	/************************** nepg工程 **************************/
}
